using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableWarehouse
	{
		public const string Table = "Warehouse";
		public const string WarehouseID = "WarehouseID";
		public const string WarehousingGoodsID = "WarehousingGoodsID";
		public const string VegetablesID = "VegetablesID";
		public const string OriginalPrice = "OriginalPrice";
		public const string TotalQty = "TotalQty";
		public const string STotalQty = "STotalQty";
		public const string EnteringDate = "EnteringDate";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
	}
	
	[Serializable]
	public class BaseWarehouse
		: IDbSessionEntity, IJsonClass
	{
		int m_WarehouseID;
		/// <summary>
        /// 库存表ID
        /// </summary>
        public int WarehouseID
        {
            get { return m_WarehouseID; }
            set { m_WarehouseID = value; }
        }
		
		int m_WarehousingGoodsID;
		/// <summary>
        /// 入库商品表ID
        /// </summary>
        public int WarehousingGoodsID
        {
            get { return m_WarehousingGoodsID; }
            set { m_WarehousingGoodsID = value; }
        }
		
		int? m_VegetablesID;
		/// <summary>
        /// 蔬菜信息表ID
        /// </summary>
        public int? VegetablesID
        {
            get { return m_VegetablesID; }
            set { m_VegetablesID = value; }
        }
		
		double m_OriginalPrice;
		/// <summary>
        /// 原价
        /// </summary>
        public double OriginalPrice
        {
            get { return m_OriginalPrice; }
            set { m_OriginalPrice = value; }
        }
		
		double m_TotalQty;
		/// <summary>
        /// 当前数量
        /// </summary>
        public double TotalQty
        {
            get { return m_TotalQty; }
            set { m_TotalQty = value; }
        }
		
		double m_STotalQty;
		/// <summary>
        /// 入库时总数量
        /// </summary>
        public double STotalQty
        {
            get { return m_STotalQty; }
            set { m_STotalQty = value; }
        }
		
		DateTime m_EnteringDate;
		/// <summary>
        /// 入库时间
        /// </summary>
        public DateTime EnteringDate
        {
            get { return m_EnteringDate; }
            set { m_EnteringDate = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 创建人ID
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 创建人名称
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 修改人
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 修改人ID
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_WarehouseID = reader[TableWarehouse.WarehouseID];
            m_WarehousingGoodsID = reader[TableWarehouse.WarehousingGoodsID];
            m_VegetablesID = reader[TableWarehouse.VegetablesID];
            m_OriginalPrice = reader[TableWarehouse.OriginalPrice];
            m_TotalQty = reader[TableWarehouse.TotalQty];
            m_STotalQty = reader[TableWarehouse.STotalQty];
            m_EnteringDate = reader[TableWarehouse.EnteringDate];
            m_Creater = reader[TableWarehouse.Creater];
            m_CreatedBy = reader[TableWarehouse.CreatedBy];
            m_Created = reader[TableWarehouse.Created];
            m_Modified = reader[TableWarehouse.Modified];
            m_ModifiedBy = reader[TableWarehouse.ModifiedBy];
            m_ModifiedByID = reader[TableWarehouse.ModifiedByID];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableWarehouse.WarehouseID, PrimaryKeyType.Identity, WarehouseID);
			writer[TableWarehouse.WarehousingGoodsID] = WarehousingGoodsID;
			writer[TableWarehouse.VegetablesID] = VegetablesID;
			writer[TableWarehouse.OriginalPrice] = OriginalPrice;
			writer[TableWarehouse.TotalQty] = TotalQty;
			writer[TableWarehouse.STotalQty] = STotalQty;
			writer[TableWarehouse.EnteringDate] = EnteringDate;
			writer[TableWarehouse.Creater] = Creater;
			writer[TableWarehouse.CreatedBy] = CreatedBy;
			writer[TableWarehouse.Created] = Created;
			writer[TableWarehouse.Modified] = Modified;
			writer[TableWarehouse.ModifiedBy] = ModifiedBy;
			writer[TableWarehouse.ModifiedByID] = ModifiedByID;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_WarehouseID = idd;
        }
		
		public string TableName
        {
            get { return TableWarehouse.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_WarehouseID = hashToRead["WarehouseID"];
			 
             m_WarehousingGoodsID = hashToRead["WarehousingGoodsID"];
			 
             m_VegetablesID = hashToRead["VegetablesID"];
			 
             m_OriginalPrice = hashToRead["OriginalPrice"];
			 
             m_TotalQty = hashToRead["TotalQty"];
			 
             m_STotalQty = hashToRead["STotalQty"];
			 
             m_EnteringDate = hashToRead["EnteringDate"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["WarehouseID"] = WarehouseID;
			 
            hashToFill["WarehousingGoodsID"] = WarehousingGoodsID;
			 
            hashToFill["VegetablesID"] = VegetablesID;
			 
            hashToFill["OriginalPrice"] = OriginalPrice;
			 
            hashToFill["TotalQty"] = TotalQty;
			 
            hashToFill["STotalQty"] = STotalQty;
			 
            hashToFill["EnteringDate"] = EnteringDate;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
        }

        #endregion
		
	}
}
